<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
	xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

<ui:define name="body">

	<rich:simpleTogglePanel switchType="client" label="Suggestion info" height="90px">
		<h:panelGrid>
			Quality:<h:outputText value="#{suggestionBean.suggestioninfo.quality}"/>
			Message:<h:outputText value="#{suggestionBean.suggestioninfo.infoMsg}"/>
		</h:panelGrid>
 	</rich:simpleTogglePanel>
 	
 	<rich:simpleTogglePanel switchType="client" label="Write a message to partners">
		<h:panelGrid>

			<h:form id="userSearch" styleClass="edit" >
				<h:inputTextarea cols="100" rows="5" value="#{suggestionBean.sentMessage}"/>
			
				<div class="actionButtons">
					
					<h:commandButton value="Send" action="#{suggestionBean.sendMessageAction}">

					</h:commandButton>
        		</div>

    		</h:form>

		</h:panelGrid>
 	</rich:simpleTogglePanel>

	

	<a:region>
		<h:form>
			<a:poll reRender="dataId" interval="5000" enabled="true"/>
		</h:form>
	</a:region>
    
    <rich:dataTable var="comm" value="#{suggestionBean.commentsOnSuggestion}" id="dataId">
    	<rich:column>
    		<h:outputText value="#{comm.user.name} said:" styleClass="label"/><br/>
    		 <h:outputText value="-->#{comm.msg}" />
    	</rich:column>
    </rich:dataTable>		    
        
</ui:define>
</ui:composition>
